package org.chartsy.uo; import java.awt.Color; import java.awt.Stroke; import java.beans.PropertyEditorSupport; import java.util.logging.Level; import org.chartsy.main.chart.AbstractPropertiesNode; import org.chartsy.main.utils.SerialVersion; import org.chartsy.main.utils.StrokeGenerator; import org.chartsy.main.utils.StrokePropertyEditor; import org.openide.nodes.Sheet; /** * * @author viorel.gheba */ public class IndicatorNode extends AbstractPropertiesNode { private static final long serialVersionUID = SerialVersion.APPVERSION; public IndicatorNode() { super("Ultimate Oscillator Properties"); } public IndicatorNode(IndicatorProperties indicatorProperties) { super("Ultimate Oscillator Properties", indicatorProperties); } @SuppressWarnings("unchecked") protected @Override Sheet createSheet() { Sheet sheet = Sheet.createDefault(); Sheet.Set set = getPropertiesSet(); sheet.put(set); try { // Label set.put(getProperty( "Label", // property name "Sets the label", // property description IndicatorProperties.class, // properties class String.class, // property class PropertyEditorSupport.class, // property editor class (null if none) "getLabel", // get method name "setLabel", // set method name IndicatorProperties.LABEL // default property value )); // Marker Visibility set.put(getProperty( "Marker Visibility", // property name "Sets the marker visibility", // property description IndicatorProperties.class, // properties class boolean.class, // property class null, // property editor class (null if none) "getMarker", // get method name "setMarker", // set method name IndicatorProperties.MARKER // default property value )); // Fast set.put(getProperty( "Fast", // property name "Sets the fast value", // property description IndicatorProperties.class, // properties class int.class, // property class null, // property editor class (null if none) "getFast", // get method name "setFast", // set method name IndicatorProperties.FAST // default property value )); // Intermediate set.put(getProperty( "Intermediate", // property name "Sets the intermediate value", // property description IndicatorProperties.class, // properties class int.class, // property class null, // property editor class (null if none) "getIntermediate", // get method name "setIntermediate", // set method name IndicatorProperties.INTERMEDIATE // default property value )); // Slow set.put(getProperty( "Slow", // property name "Sets the slow value", // property description IndicatorProperties.class, // properties class int.class, // property class null, // property editor class (null if none) "getSlow", // get method name "setSlow", // set method name IndicatorProperties.SLOW // default property value )); // Line Color set.put(getProperty( "Line Color", // property name "Sets the line color", // property description IndicatorProperties.class, // properties class Color.class, // property class null, // property editor class (null if none) "getColor", // get method name "setColor", // set method name IndicatorProperties.COLOR // default property value )); // Line Style set.put(getProperty( "Line Style", // property name "Sets the line style", // property description IndicatorProperties.class, // properties class Stroke.class, // property class StrokePropertyEditor.class, // property editor class (null if none) "getStroke", // get method name "setStroke", // set method name StrokeGenerator.getStroke(IndicatorProperties.STROKE_INDEX) // default property value )); } catch (NoSuchMethodException ex) { LOG.log(Level.SEVERE, "[Ultimate Oscillator Node] : Method does not exist.", ex); } return sheet; } }